/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package extension.room.tan;

import extension.game.room.RoomExtension;
import extension.tan.handler.ChooseMasterCardHandler;
import extension.tan.handler.FightCardHandler;
import extension.tan.handler.FinishAttackHandler;
import extension.tan.handler.RegisterAttackHandler;
import extension.tan.handler.TanCommand;
import extension.tan.handler.TimeOutHandler;

/**
 *
 * @author daz
 */
public class TanExtension extends RoomExtension {

    private TanGame tanGame;
    private TanResponse response;

    @Override
    public void init() {
        prefixLength = 1;
        startupRoom();
    }

    @Override
    public void addHandler() {
        super.addHandler();
        addRequestHandler(TanCommand.FIGHT_CARD, FightCardHandler.class);
        addRequestHandler(TanCommand.FINISH_ATTACK, FinishAttackHandler.class);
        addRequestHandler(TanCommand.CHOOSE_MASTER_CARD, ChooseMasterCardHandler.class);
        addRequestHandler(TanCommand.FIGHT_TIME_OUT, TimeOutHandler.class);
        addRequestHandler(TanCommand.ASK_REGISTER_ATTACK, RegisterAttackHandler.class);

//        addRequestHandler(PhomCommand.DRAW_CARD, GetCardHandler.class);
//        addRequestHandler(PhomCommand.SHOW_PHOM, ShowPhomHandler.class);
//        addRequestHandler(PhomCommand.EAT_CARD, EatCardHandler.class);
//        addRequestHandler(PhomCommand.DEPOSIT_CARD, DepositCardHandler.class);
//        addRequestHandler(PhomCommand.NOTIFY_PHOM_MORE, MorePhomHandler.class);
//        addRequestHandler(PhomCommand.CHOOSE_PHOM, ChoosePhomHandler.class);
//        addRequestHandler(PhomCommand.TIME_OUT, TimeOutHandler.class);

    }

    @Override
    public TanGame getGame() {
        return this.tanGame;
    }

    @Override
    public void initGame(int roomId) {
        response = new TanResponse(this);
        tanGame = new TanGame(this, roomId);
//        phomGame.start();
    }

    @Override
    public TanResponse getResponse() {
        return this.response;
    }
}
